import React,{ Component } from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
// import Home from './pages/Home';
import registerServiceWorker from './registerServiceWorker';
import {BrowserRouter as Router,Route,Link}from 'react-router-dom';
import AsyncComponent from './components/AsyncComponent';

// ReactDOM.render(<App />, document.getElementById('root'));
//异步导入
const AsyncHome = AsyncComponent(() => import("./pages/Home"));

ReactDOM.render(
         <Router>
                <div>
                    <Route exact path="/" component={App} />
                    <Route path="/Home" component={AsyncHome} />
                </div>
            </Router>,
document.getElementById('root'));
registerServiceWorker();
